﻿using IdentityServer4.EntityFramework.DbContexts;
using IdentityServer4.EntityFramework.Entities;
using IdentityServer4.EntityFramework.Options;
using Microsoft.EntityFrameworkCore;

namespace Devonline.Identity.Admin.Models;

/// <summary>
/// DbContext for the IdentityServer configuration data.
/// </summary>
/// <seealso cref="DbContext" />
/// <seealso cref="IdentityServer4.EntityFramework.Interfaces.IConfigurationDbContext" />
public class ConfigurationDbContext : ConfigurationDbContext<ConfigurationDbContext>
{
    /// <summary>
    /// Initializes a new instance of the <see cref="ConfigurationDbContext"/> class.
    /// </summary>
    /// <param name="options">The options.</param>
    /// <param name="storeOptions">The store options.</param>
    /// <exception cref="ArgumentNullException">storeOptions</exception>
    public ConfigurationDbContext(DbContextOptions<ConfigurationDbContext> options, ConfigurationStoreOptions storeOptions) : base(options, storeOptions) { }

    public DbSet<ApiResourceClaim> ApiResourceClaims { get; set; }
    public DbSet<ApiResourceProperty> ApiResourceProperties { get; set; }
    public DbSet<ApiResourceScope> ApiResourceScopes { get; set; }
    public DbSet<ApiResourceSecret> ApiSecrets { get; set; }

    public DbSet<ApiScopeClaim> ApiScopeClaims { get; set; }
    public DbSet<ApiScopeProperty> ApiScopeProperties { get; set; }

    public DbSet<ClientGrantType> ClientGrantTypes { get; set; }
    public DbSet<ClientClaim> ClientClaims { get; set; }
    public DbSet<ClientProperty> ClientProperties { get; set; }
    public DbSet<ClientScope> ClientScopes { get; set; }
    public DbSet<ClientSecret> ClientSecrets { get; set; }
    public DbSet<ClientPostLogoutRedirectUri> ClientPostLogoutRedirectUris { get; set; }
    public DbSet<ClientIdPRestriction> ClientIdPRestrictions { get; set; }
    public DbSet<ClientRedirectUri> ClientRedirectUris { get; set; }

    public DbSet<IdentityResourceClaim> IdentityClaims { get; set; }
    public DbSet<IdentityResourceProperty> IdentityResourceProperties { get; set; }
}
